<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\DistributionBean;

class DistributionValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 DistributionBean::$id => 'require', //
			 DistributionBean::$distance => 'require', //距离（单位：米）
			 DistributionBean::$price => 'require', //费用(如果是0，不配送)
			 DistributionBean::$storeId => 'require', //0平台默认设置
		];
		$this->message = [
			DistributionBean::$id.POINST."require " => 'id必须', //
			DistributionBean::$distance.POINST."require " => 'distance必须', //距离（单位：米）
			DistributionBean::$price.POINST."require " => 'price必须', //费用(如果是0，不配送)
			DistributionBean::$storeId.POINST."require " => 'store_id必须', //0平台默认设置
		];
		$this->scene = [
			self::$all => [
				DistributionBean::$id,
				DistributionBean::$distance,
				DistributionBean::$price,
			],
			self::$add => [
				DistributionBean::$distance,
			],
			self::$edit => [
				DistributionBean::$id,
				DistributionBean::$distance,
			],
			self::$pkId => [],

		];
	}


}
